package com.sjc.consumer.dao;

import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Param;
import org.apache.ibatis.annotations.Update;

@Mapper
public interface TransferDao {
    @Update("update tb_account_two set amount = amount - #{amount},frozen = frozen + #{frozen} where acct_id = #{acctId}")
    int decreaseAmount(@Param("acctId") String accountId, @Param("amount") double amount,@Param("frozen") double frozen);

    @Update("update tb_account_two set amount = amount + #{amount},frozen = frozen - #{frozen} where acct_id = #{acctId}")
    int cancelDecrease(@Param("acctId") String accountId, @Param("amount") double amount, @Param("frozen") double frozen);

}
